.class public Lcom/bytedance/sdk/openadsdk/i/a;
.super Ljava/lang/Object;
.source "TTExecutor.java"


# static fields
.field private static volatile a:Lcom/bytedance/sdk/openadsdk/i/a;

.field private static volatile b:Ljava/util/concurrent/ThreadPoolExecutor;

.field private static volatile c:Ljava/util/concurrent/ThreadPoolExecutor;

.field private static volatile d:Ljava/util/concurrent/ThreadPoolExecutor;

.field private static volatile e:Ljava/util/concurrent/ThreadPoolExecutor;

.field private static volatile f:Ljava/util/concurrent/ScheduledExecutorService;

.field private static g:Ljava/util/concurrent/ConcurrentHashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/ConcurrentHashMap<",
            "Ljava/lang/String;",
            "Lcom/bytedance/sdk/openadsdk/i/c;",
            ">;"
        }
    .end annotation
.end field

.field private static final h:Ljava/util/concurrent/ConcurrentHashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/ConcurrentHashMap<",
            "Ljava/lang/String;",
            "Lcom/bytedance/sdk/openadsdk/i/c;",
            ">;"
        }
    .end annotation
.end field

.field private static final i:Ljava/util/concurrent/ConcurrentHashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/ConcurrentHashMap<",
            "Ljava/lang/String;",
            "Lcom/bytedance/sdk/openadsdk/i/c;",
            ">;"
        }
    .end annotation
.end field

.field private static final j:Ljava/util/concurrent/ConcurrentHashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/ConcurrentHashMap<",
            "Ljava/lang/String;",
            "Lcom/bytedance/sdk/openadsdk/i/c;",
            ">;"
        }
    .end annotation
.end field

.field private static final k:Ljava/util/concurrent/atomic/AtomicBoolean;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 1
    new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;

    invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V

    sput-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->h:Ljava/util/concurrent/ConcurrentHashMap;

    .line 2
    new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;

    invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V

    sput-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->i:Ljava/util/concurrent/ConcurrentHashMap;

    .line 3
    new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;

    invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V

    sput-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->j:Ljava/util/concurrent/ConcurrentHashMap;

    .line 4
    new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>()V

    sput-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->k:Ljava/util/concurrent/atomic/AtomicBoolean;

    return-void
.end method

.method private constructor <init>()V
    .locals 1

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->k:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    .line 3
    invoke-static {v0}, Lcom/bytedance/sdk/openadsdk/i/a;->a(Z)V

    :cond_0
    return-void
.end method

.method public static a()Lcom/bytedance/sdk/openadsdk/i/a;
    .locals 2

    .line 9
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->a:Lcom/bytedance/sdk/openadsdk/i/a;

    if-nez v0, :cond_1

    .line 10
    const-class v0, Lcom/bytedance/sdk/openadsdk/i/a;

    monitor-enter v0

    .line 11
    :try_start_0
    sget-object v1, Lcom/bytedance/sdk/openadsdk/i/a;->a:Lcom/bytedance/sdk/openadsdk/i/a;

    if-nez v1, :cond_0

    .line 12
    new-instance v1, Lcom/bytedance/sdk/openadsdk/i/a;

    invoke-direct {v1}, Lcom/bytedance/sdk/openadsdk/i/a;-><init>()V

    sput-object v1, Lcom/bytedance/sdk/openadsdk/i/a;->a:Lcom/bytedance/sdk/openadsdk/i/a;

    .line 13
    :cond_0
    monitor-exit v0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1

    .line 14
    :cond_1
    :goto_0
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->a:Lcom/bytedance/sdk/openadsdk/i/a;

    return-object v0
.end method

.method public static a(Z)V
    .locals 1

    .line 1
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->k:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z

    move-result v0

    if-eqz v0, :cond_0

    return-void

    .line 2
    :cond_0
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/i/e;->a()Ljava/util/concurrent/ThreadPoolExecutor;

    move-result-object v0

    sput-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->b:Ljava/util/concurrent/ThreadPoolExecutor;

    .line 3
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/i/e;->b()Ljava/util/concurrent/ThreadPoolExecutor;

    move-result-object v0

    sput-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->c:Ljava/util/concurrent/ThreadPoolExecutor;

    .line 4
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/i/e;->c()Ljava/util/concurrent/ScheduledExecutorService;

    move-result-object v0

    sput-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->f:Ljava/util/concurrent/ScheduledExecutorService;

    .line 5
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/i/e;->e()Ljava/util/concurrent/ThreadPoolExecutor;

    move-result-object v0

    sput-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->e:Ljava/util/concurrent/ThreadPoolExecutor;

    if-eqz p0, :cond_1

    .line 6
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/i/e;->d()Ljava/util/concurrent/ThreadPoolExecutor;

    move-result-object p0

    sput-object p0, Lcom/bytedance/sdk/openadsdk/i/a;->d:Ljava/util/concurrent/ThreadPoolExecutor;

    .line 7
    new-instance p0, Ljava/util/concurrent/ConcurrentHashMap;

    invoke-direct {p0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V

    sput-object p0, Lcom/bytedance/sdk/openadsdk/i/a;->g:Ljava/util/concurrent/ConcurrentHashMap;

    .line 8
    :cond_1
    sget-object p0, Lcom/bytedance/sdk/openadsdk/i/a;->k:Ljava/util/concurrent/atomic/AtomicBoolean;

    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    return-void
.end method

.method private c()V
    .locals 1

    .line 1
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->d:Ljava/util/concurrent/ThreadPoolExecutor;

    if-nez v0, :cond_0

    .line 2
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/i/e;->d()Ljava/util/concurrent/ThreadPoolExecutor;

    move-result-object v0

    sput-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->d:Ljava/util/concurrent/ThreadPoolExecutor;

    .line 3
    new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;

    invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V

    sput-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->g:Ljava/util/concurrent/ConcurrentHashMap;

    :cond_0
    return-void
.end method


# virtual methods
.method public a(Ljava/lang/Runnable;J)Ljava/util/concurrent/ScheduledFuture;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Runnable;",
            "J)",
            "Ljava/util/concurrent/ScheduledFuture<",
            "*>;"
        }
    .end annotation

    const/4 v0, 0x0

    if-nez p1, :cond_1

    .line 27
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/utils/u;->c()Z

    move-result p1

    if-eqz p1, :cond_0

    const-string p1, ""

    const-string p2, "delayExecuteTask->runnable param is not be null"

    .line 28
    invoke-static {p1, p2}, Lcom/bytedance/sdk/openadsdk/utils/u;->e(Ljava/lang/String;Ljava/lang/String;)V

    :cond_0
    return-object v0

    :cond_1
    const-wide/16 v1, 0x0

    cmp-long v3, p2, v1

    if-gtz v3, :cond_2

    .line 29
    sget-object p2, Lcom/bytedance/sdk/openadsdk/i/a;->f:Ljava/util/concurrent/ScheduledExecutorService;

    invoke-interface {p2, p1}, Ljava/util/concurrent/ScheduledExecutorService;->execute(Ljava/lang/Runnable;)V

    return-object v0

    .line 30
    :cond_2
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->f:Ljava/util/concurrent/ScheduledExecutorService;

    sget-object v1, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-interface {v0, p1, p2, p3, v1}, Ljava/util/concurrent/ScheduledExecutorService;->schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;

    move-result-object p1

    return-object p1
.end method

.method public a(Lcom/bytedance/sdk/openadsdk/i/c;)V
    .locals 1

    if-nez p1, :cond_1

    .line 19
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/utils/u;->c()Z

    move-result p1

    if-eqz p1, :cond_0

    const-string p1, ""

    const-string v0, "executeApiTask->TTRunnable param is not be null"

    .line 20
    invoke-static {p1, v0}, Lcom/bytedance/sdk/openadsdk/utils/u;->e(Ljava/lang/String;Ljava/lang/String;)V

    :cond_0
    return-void

    .line 21
    :cond_1
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->b:Ljava/util/concurrent/ThreadPoolExecutor;

    if-eqz v0, :cond_2

    .line 22
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->b:Ljava/util/concurrent/ThreadPoolExecutor;

    invoke-virtual {v0, p1}, Ljava/util/concurrent/ThreadPoolExecutor;->execute(Ljava/lang/Runnable;)V

    :cond_2
    return-void
.end method

.method public a(Lcom/bytedance/sdk/openadsdk/i/c;J)V
    .locals 7

    if-nez p1, :cond_1

    .line 23
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/utils/u;->c()Z

    move-result p1

    if-eqz p1, :cond_0

    const-string p1, ""

    const-string p2, "scheduleWithFixedDelayTask->TTRunnable param is not be null"

    .line 24
    invoke-static {p1, p2}, Lcom/bytedance/sdk/openadsdk/utils/u;->e(Ljava/lang/String;Ljava/lang/String;)V

    :cond_0
    return-void

    :cond_1
    const-wide/16 v0, 0x0

    cmp-long v2, p2, v0

    if-gtz v2, :cond_2

    .line 25
    sget-object p2, Lcom/bytedance/sdk/openadsdk/i/a;->f:Ljava/util/concurrent/ScheduledExecutorService;

    invoke-interface {p2, p1}, Ljava/util/concurrent/ScheduledExecutorService;->execute(Ljava/lang/Runnable;)V

    goto :goto_0

    .line 26
    :cond_2
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->f:Ljava/util/concurrent/ScheduledExecutorService;

    const-wide/16 v2, 0x0

    sget-object v6, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;

    move-object v1, p1

    move-wide v4, p2

    invoke-interface/range {v0 .. v6}, Ljava/util/concurrent/ScheduledExecutorService;->scheduleWithFixedDelay(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;

    :goto_0
    return-void
.end method

.method public a(Ljava/lang/Runnable;I)V
    .locals 2

    if-nez p1, :cond_1

    .line 15
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/utils/u;->c()Z

    move-result p1

    if-eqz p1, :cond_0

    const-string p1, ""

    const-string p2, "executeAIDLTask -> runnable param is not be null"

    .line 16
    invoke-static {p1, p2}, Lcom/bytedance/sdk/openadsdk/utils/u;->e(Ljava/lang/String;Ljava/lang/String;)V

    :cond_0
    return-void

    .line 17
    :cond_1
    invoke-direct {p0}, Lcom/bytedance/sdk/openadsdk/i/a;->c()V

    .line 18
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->d:Ljava/util/concurrent/ThreadPoolExecutor;

    new-instance v1, Lcom/bytedance/sdk/openadsdk/i/a$1;

    invoke-direct {v1, p0, p2, p1}, Lcom/bytedance/sdk/openadsdk/i/a$1;-><init>(Lcom/bytedance/sdk/openadsdk/i/a;ILjava/lang/Runnable;)V

    invoke-virtual {v0, v1}, Ljava/util/concurrent/ThreadPoolExecutor;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method public b()Ljava/util/concurrent/ExecutorService;
    .locals 1

    .line 1
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->e:Ljava/util/concurrent/ThreadPoolExecutor;

    if-nez v0, :cond_0

    .line 2
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/i/e;->e()Ljava/util/concurrent/ThreadPoolExecutor;

    move-result-object v0

    sput-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->e:Ljava/util/concurrent/ThreadPoolExecutor;

    .line 3
    :cond_0
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->e:Ljava/util/concurrent/ThreadPoolExecutor;

    return-object v0
.end method

.method public b(Lcom/bytedance/sdk/openadsdk/i/c;)V
    .locals 1

    if-nez p1, :cond_1

    .line 8
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/utils/u;->c()Z

    move-result p1

    if-eqz p1, :cond_0

    const-string p1, ""

    const-string v0, "executeDefaultTask -> runnable param is not be null"

    .line 9
    invoke-static {p1, v0}, Lcom/bytedance/sdk/openadsdk/utils/u;->e(Ljava/lang/String;Ljava/lang/String;)V

    :cond_0
    return-void

    .line 10
    :cond_1
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->c:Ljava/util/concurrent/ThreadPoolExecutor;

    if-eqz v0, :cond_2

    .line 11
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->c:Ljava/util/concurrent/ThreadPoolExecutor;

    invoke-virtual {v0, p1}, Ljava/util/concurrent/ThreadPoolExecutor;->execute(Ljava/lang/Runnable;)V

    :cond_2
    return-void
.end method

.method public b(Ljava/lang/Runnable;I)V
    .locals 2

    if-nez p1, :cond_1

    .line 4
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/utils/u;->c()Z

    move-result p1

    if-eqz p1, :cond_0

    const-string p1, ""

    const-string p2, "executeApiTask->runnable param is not be null"

    .line 5
    invoke-static {p1, p2}, Lcom/bytedance/sdk/openadsdk/utils/u;->e(Ljava/lang/String;Ljava/lang/String;)V

    :cond_0
    return-void

    .line 6
    :cond_1
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->b:Ljava/util/concurrent/ThreadPoolExecutor;

    if-eqz v0, :cond_2

    .line 7
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->b:Ljava/util/concurrent/ThreadPoolExecutor;

    new-instance v1, Lcom/bytedance/sdk/openadsdk/i/a$2;

    invoke-direct {v1, p0, p2, p1}, Lcom/bytedance/sdk/openadsdk/i/a$2;-><init>(Lcom/bytedance/sdk/openadsdk/i/a;ILjava/lang/Runnable;)V

    invoke-virtual {v0, v1}, Ljava/util/concurrent/ThreadPoolExecutor;->execute(Ljava/lang/Runnable;)V

    :cond_2
    return-void
.end method

.method public c(Ljava/lang/Runnable;I)V
    .locals 2

    if-nez p1, :cond_1

    .line 4
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/utils/u;->c()Z

    move-result p1

    if-eqz p1, :cond_0

    const-string p1, ""

    const-string p2, "executeDefaultTask -> runnable param is not be null"

    .line 5
    invoke-static {p1, p2}, Lcom/bytedance/sdk/openadsdk/utils/u;->e(Ljava/lang/String;Ljava/lang/String;)V

    :cond_0
    return-void

    .line 6
    :cond_1
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->c:Ljava/util/concurrent/ThreadPoolExecutor;

    if-eqz v0, :cond_2

    .line 7
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->c:Ljava/util/concurrent/ThreadPoolExecutor;

    new-instance v1, Lcom/bytedance/sdk/openadsdk/i/a$3;

    invoke-direct {v1, p0, p2, p1}, Lcom/bytedance/sdk/openadsdk/i/a$3;-><init>(Lcom/bytedance/sdk/openadsdk/i/a;ILjava/lang/Runnable;)V

    invoke-virtual {v0, v1}, Ljava/util/concurrent/ThreadPoolExecutor;->execute(Ljava/lang/Runnable;)V

    :cond_2
    return-void
.end method

.method public d(Ljava/lang/Runnable;I)V
    .locals 2

    if-nez p1, :cond_1

    .line 1
    invoke-static {}, Lcom/bytedance/sdk/openadsdk/utils/u;->c()Z

    move-result p1

    if-eqz p1, :cond_0

    const-string p1, ""

    const-string p2, "executeLogUploadTask\uff08Runnable\uff09 -> runnable param is not be null"

    .line 2
    invoke-static {p1, p2}, Lcom/bytedance/sdk/openadsdk/utils/u;->e(Ljava/lang/String;Ljava/lang/String;)V

    :cond_0
    return-void

    .line 3
    :cond_1
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->e:Ljava/util/concurrent/ThreadPoolExecutor;

    if-eqz v0, :cond_2

    .line 4
    sget-object v0, Lcom/bytedance/sdk/openadsdk/i/a;->e:Ljava/util/concurrent/ThreadPoolExecutor;

    new-instance v1, Lcom/bytedance/sdk/openadsdk/i/a$4;

    invoke-direct {v1, p0, p2, p1}, Lcom/bytedance/sdk/openadsdk/i/a$4;-><init>(Lcom/bytedance/sdk/openadsdk/i/a;ILjava/lang/Runnable;)V

    invoke-virtual {v0, v1}, Ljava/util/concurrent/ThreadPoolExecutor;->execute(Ljava/lang/Runnable;)V

    :cond_2
    return-void
.end method
